<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/templates/template_admin.xhtml">
        <ui:define name="content">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form prependId="false">
                    <h1><h:outputText value="Create Interview"/></h1>
                    <h:panelGrid columns="2">
                        <h:outputLabel value="InterviewID" for="interviewID" />
                        <h:inputText id="interviewID" value="#{hrmb.in.interviewID}" required="true" requiredMessage="The InterviewID field is required."/>
                        <h:outputLabel value="Status:" for="status" />
                        <h:selectOneMenu id="status" value="#{hrmb.in.status}" >
                        <f:selectItem itemLabel="Not" itemValue="1"/>
                        <f:selectItem itemLabel="Inspect" itemValue="2" />
                    </h:selectOneMenu>
                        <h:outputLabel value="AVStatus:" for="AVStatus" />
                        <h:selectOneMenu id="AVStatus" value="#{hrmb.in.AVStatus}" >
                        <f:selectItem itemLabel="Not" itemValue="1"/>
                        <f:selectItem itemLabel="Reach" itemValue="2" />
                    </h:selectOneMenu>
                        <h:outputLabel value="StartedTime:" for="startedTime" />
                         <p:calendar value="#{hrmb.in.startedTime}"
                                            id="startedTime"
                                            navigator="true"
                                            yearRange="c-50:c+50"
                                            mindate="1/1/62"
                                            maxdate="#{calendarMB.currentDate}"
                                            pattern="yyyy-MM-dd"
                                            styleClass="remove"
                                            required="true"
                                            requiredMessage="You must enter start time."
                                            validator="#{vlmb.validatedatestart}">
                                </p:calendar>
                        <h:outputLabel value="EndedTime:" for="endedTime" />
                        <p:calendar value="#{hrmb.in.endedTime}"
                                            id="endedTime"
                                            navigator="true"
                                            yearRange="c-50:c+50"
                                            mindate="1/1/62"
                                            maxdate="#{calendarMB.currentDate}"
                                            pattern="yyyy-MM-dd"
                                            styleClass="remove"
                                            required="true"
                                            requiredMessage="You must enter date end"
                                            validator="#{vlmb.validatedateend}">
                                </p:calendar>
                        <h:outputLabel value="EmployeeID:" for="employeeID" />
                        <h:selectOneMenu id="employeeID" value="#{hrmb.employeeID}">
                            <f:selectItems var="e" value="#{intermb.emplistin()}" itemLabel="#{e.firstName} #{e.lastName}" itemValue="#{e.employeeID}"/>
                    </h:selectOneMenu>
                        <h:outputLabel value="Cvid:" for="cvid" />
                        <h:selectOneMenu id="cvid" value="#{hrmb.cvID}">
                            <f:selectItems var="cv" value="#{intermb.cvlistin()}" itemLabel="#{cv.vacancyID.title}-#{cv.applicantID.firstName} #{cv.applicantID.lastName}" itemValue="#{cv.cvid}"></f:selectItems>
                    </h:selectOneMenu>
                    </h:panelGrid>
                    <h:commandButton action="#{hrmb.addInter()}" value="Save" />
                <br />
                <h:commandButton action="ListInterview" value="List"/>
                <br />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
